<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich"
    xmlns:spring="http://www.springframework.org/tags">

<ui:composition template="/templates/main.xhtml">
    <ui:define name="head">
    	<script type="text/javascript">
    		jQuery(document).ready(function(){
				jQuery("#j_username").focus();
			});
    	</script>
    </ui:define>
    
    <ui:define name="body">

	<form name="f" action="j_spring_security_check" method="post">

		<rich:panel>
	        <f:facet name="header">
	        	<h:outputText value="Login"/>
	        </f:facet>
	        
	        <h:outputText value="Your login attempt was not successful, try again. &lt;br/&gt; &lt;br/&gt;
		        Reason: ${SPRING_SECURITY_LAST_EXCEPTION.message}" rendered="#{not empty param['login_error']}" style="color: red" escape="false" />
	        
	        <h:panelGrid columns="2" title="Login" rowClasses="s1row" columnClasses="gridLabel,gridValue">
		        <h:outputText value="User: " />
				<input type="text" id="j_username" name="j_username" value="${not empty param.login_error ? SPRING_SECURITY_LAST_USERNAME : ''}"/>
				
				<h:outputText value="Password: " />
				<input type="password" name="j_password" />
				
				<f:facet name="footer"> 
					<a class="button-blue" style="padding:6px 20px;" onclick="document.f.submit()">Access</a>
				</f:facet>
			</h:panelGrid>
	   	</rich:panel>
	</form>

	</ui:define>
</ui:composition>    
    
</html>